Use artifact.test to determine if an executable is a test one#72
Merged
ian-h-chamberlain merged 1 commit intorust3ds:masterfrom Mar 20, 2025
Merged
Use artifact.test to determine if an executable is a test one#72ian-h-chamberlain merged 1 commit intorust3ds:masterfrom
ian-h-chamberlain merged 1 commit intorust3ds:masterfrom
Conversation
`artifact.target.test` seems to only tell if the executable _has_ tests, not whether it _is_ a test executable
| // when a single executable is built anyway but maybe not in all cases. | ||
| let name = match artifact.target.kind[0].as_ref() { | ||
| "bin" | "lib" | "rlib" | "dylib" if artifact.target.test => { | ||
| "bin" | "lib" | "rlib" | "dylib" if artifact.profile.test => { |
Member
There was a problem hiding this comment.
Looks okay to me; the cargo_metadata docs are a little unclear (to me) about the difference but I guess Whether or not this target is tested by default by cargo test would in fact be true for most lib targets so I'm surprised I never noticed this before... I guess because we don't generally build .3dsx for libs
Contributor
Author
There was a problem hiding this comment.
Seems to also be true for binaries (or, at least, my binary), so I do wonder how it was never caught before!
ian-h-chamberlain
approved these changes
Mar 20, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
artifact.target.testseems to only tell if the executable has tests, not whether it is a test executableThis was causing ordinary executables to be named as if they were tests